package net.borlis.configuration.common;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author alex@borlis.net
 */
public abstract class StandardConfiguration implements ApplicationConfiguration {

    //-=-=-=-
    private String jdbcUrl;
    private String jdbcUser;
    private String jdbcPassword;

    private String schemaVersion;
    private String driverName;
    //-=-=-=
    private String server;
    private String port;
    //-=-=-=
    private Boolean autoUpdate;
    // -=-=-
    private String encryptionServiceURL;
    private String encryptionServiceLogin;
    private String encryptionServicePassword;
    // -=-=-
    private String clientKey;

    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    public void setJdbcUser(String jdbcUser) {
        this.jdbcUser = jdbcUser;
    }

    public void setJdbcPassword(String jdbcPassword) {
        this.jdbcPassword = jdbcPassword;
    }

    public void setSchemaVersion(String schemaVersion) {
        this.schemaVersion = schemaVersion;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public void setAutoUpdate(Boolean autoUpdate) {
        this.autoUpdate = autoUpdate;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getJdbcUrlDraft() {
        return jdbcUrl;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getJdbcUser() {
        return jdbcUser;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getJdbcPassword() {
        return jdbcPassword;
    }

    @Override
    public String getDriverName() {
        return driverName;
    }

    @Override
    public String getSchemaVersion() {
        return schemaVersion;
    }

    @Override
    public String getServer() {
        return server;
    }

    @Override
    public String getPort() {
        return port;
    }

    @Override
    public Boolean getAutoUpdate() {
        return autoUpdate;
    }

    public String getJdbcUrl() {
        return jdbcUrl;
    }

    public String getEncryptionServiceURL() {
        return encryptionServiceURL;
    }

    public void setEncryptionServiceURL(String encryptionServiceURL) {
        this.encryptionServiceURL = encryptionServiceURL;
    }

    public String getEncryptionServiceLogin() {
        return encryptionServiceLogin;
    }

    public void setEncryptionServiceLogin(String encryptionServiceLogin) {
        this.encryptionServiceLogin = encryptionServiceLogin;
    }

    public String getEncryptionServicePassword() {
        return encryptionServicePassword;
    }

    public void setEncryptionServicePassword(String encryptionServicePassword) {
        this.encryptionServicePassword = encryptionServicePassword;
    }

    @Override
    public String getClientKey() {
        return clientKey;
    }

    public void setClientKey(String clientKey) {
        this.clientKey = clientKey;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this).
                append("jdbcUrl", getJdbcUrlDraft()).
                append("jdbcUser", getJdbcUser()).
                append("schemaVersion", getSchemaVersion()).
                append("driverName", getDriverName()).
                append("autoUpdate", getAutoUpdate()).
                append("encServiceLogin", getEncryptionServiceLogin()).
                append("encServiceURL", getEncryptionServiceURL()).
                append("clientKey", getClientKey()).
                toString();
    }

}
